#pragma once
#include "GridHeader.h"
#include "GridRow.h"
#define  CHTLD_WIDTH  18
#define  ROW_HEIGHT   28
class CManGrid
{
public:
	CManGrid(void);
	virtual ~CManGrid(void);
public:
	static CString RegisterWindowClass (LPCTSTR lpszClassNamePrefix);
	static BOOL    _Cal_GridHeaderRect(CGridHeader &GridHeader,CSize &Sz);
	static BOOL    _Cal_GridListRect(CPoint pt,vector<CGridRow*> &pGridRow,CGridHeader &GridHeader,CPoint &StartpT);

	static CGridRow *_Find_GridPtRow(const vector<CGridRow*> &vGridListRow,const CPoint &pT,int &nFlg);
	static CGridBaseItem *_Find_GridPtItem(vector<CGridBaseItem*> &vListItem,const CPoint pT);

	static void _Init_SelItem(vector<CGridBaseItem*> &vGridListItem,BOOL bL);
	//
	static CRect	Convser1X_S(const CRect &rc,CSize sz,int nIndex,int nFreezeColumns);
	static CPoint	Convser1X_S(const CPoint &pt,CSize sz,int nIndex,int nFreezeColumns);
	static CPoint	Convser1S_X(const CPoint &pt,CSize sz,int nFreezelenght);

	static CRect	Convser2X_S(const CRect &rc,CSize sz);
	static CPoint	Convser2X_S(const CPoint &pt,CSize sz);

};
